package com.kgc.service;

import com.kgc.bean.GoodsItem;
import com.kgc.bean.HotWord;
import com.kgc.form.ElasticsearchGoodsResult;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * Created on 2021/6/21.
 * Author: lzy
 * Description: Elasticsearch 业务处理
 */
public interface ElasticsearchService {

    /**
    *@ClassName: ElasticsearchService
    *@Description  进行查询，带高亮，带分页
    *@Author lzy
    *@Date 2021/6/21
    */
    List<ElasticsearchGoodsResult> elsearchHighlightPage(String keyword, Integer pageNo, Integer pageSize) throws IOException;
    

    /**
    *@ClassName: ElasticsearchService
    *@Description 添加查询词到热词库，没有就添加，有就在原来的基础上加1
    *@Author lzy
    *@Date 2021/6/21
    */
    void hotwordZincrby(String hotword);


    /**
    *@ClassName: ElasticsearchService
    *@Description 查询热词
    *@Author lzy
    *@Date 2021/6/22
    */
    List<HotWord> querySelectHotWord5();


    List<GoodsItem> queryNewProduct();

    /**
    *@ClassName: ElasticsearchService
    *@Description 取数据库模糊查询数据
    *@Author lzy
    *@Date 2021/6/24
    */
    List<ElasticsearchGoodsResult> querySelectGoodsItemByKeyword(String keyword,Integer pageNo,Integer pageSize);

    /**
    *@ClassName: ElasticsearchService
    *@Description 保存数据到elasticsearch
    *@Author lzy
    *@Date 2021/6/24
    */
    void saveGoodsItemToElasticsearch(List<ElasticsearchGoodsResult> elasticsearchGoodsResults);

    /**
    *@ClassName: ElasticsearchService
    *@Description 判断热词库是否存在该rci
    *@Author lzy
    *@Date 2021/6/28
    */
    HotWord queryKeyWordIsHave(String keyword);



}
